home *** CD-ROM | disk | FTP | other *** search
/ Extreme Heat: Share the Heat (Special Edition) / Extreme Heat - Share the Heat - Special Edition (TCD 5002) (CD Factory).iso / viewer / gifdecod.gif (.png) < prev    next >
Graphics Interchange Format  |  1992-08-06  |  7KB  |  640x350  |  4-bit (4 colors)
Labels: text | diagram | font | screenshot
OCR: GIF Decoder by Bob Montgomery 1-22-87 Notes: 1. nuc = next valid code Init decoder 2. A code is decomposed into a string of colors Get new_code (color) 3. Colors are pushed onto a stack so they can oldcode = color = new_code be output last first, which is the order print(color) the encoder saw them. 4. Init decoder: codesize = bits/pixel + 1 clear_code = 1 << bit/pixel Get new_code end_code = clear_code + 1 code = new_code min_code = end_code + 1 max_code = clear_code << 1 Is it the next valid code? nvc = end_code + 1 code Envc ?- Y 5. If codesize > 12, Init decoder code = old_code push color It was a color Is it a code? colors Save new string = code ~code > N push color min_code. shadelnyc] = color child[nvc] = old_code Decompose the code old_code = new_code push shade[code] nvc = nvc + 1 code = child[code] Send colors to display pop all off stack to output Increase codesize if req'd